package com.dkm.ec.relation.repository.impl;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Repository;

import com.dkm.base.api.model.Page;
import com.dkm.base.core.helper.SpringHelper;
import com.dkm.base.db.persistence.dao.IQueryDao;
import com.dkm.biz.repository.AbstractRepository;
import com.dkm.ec.relation.domain.AddFriendHi;
import com.dkm.ec.relation.repository.AddFriendHiRepository;
import com.dkm.ec.relation.persistence.dao.AddFriendHiQueryDao;
import com.dkm.ec.relation.persistence.entity.AddFriendHiPo;

/**
 * 对象功能:t_relation_add_friend_hi Repository接口的实现类
 * 开发公司:dkm.com
 * 开发人员:ZHH
 * 创建时间:2017-07-22 10:40:06
 */
@Repository
public class AddFriendHiRepositoryImpl extends AbstractRepository<String, AddFriendHiPo,AddFriendHi> implements AddFriendHiRepository{
	  
	@Resource
	private  AddFriendHiQueryDao addFriendHiQueryDao;

	public AddFriendHi newInstance() {
		AddFriendHiPo po = new AddFriendHiPo();
		AddFriendHi addFriendHi = SpringHelper.getBean(AddFriendHi.class);
		addFriendHi.setData(po);
		return addFriendHi;
	}

	public AddFriendHi newInstance(AddFriendHiPo po) {
		AddFriendHi addFriendHi = SpringHelper.getBean(AddFriendHi.class);
		addFriendHi.setData(po);
		return addFriendHi;
	} 
	
	@Override
	protected IQueryDao<String, AddFriendHiPo> getQueryDao() {
		return addFriendHiQueryDao;
	}

	@Override
	public List<AddFriendHiPo> findByRequestById(String requstPatyId,Page page) {
		Map<String, Object> params = new HashMap<String, Object>();
		params.put("requstPatyId", requstPatyId);
		return addFriendHiQueryDao.findByKey("findByRequestById", params,page);
	}
	
}
